<template>
  <div class="full-box shadow-box padding-box">
    <div class="operate-bar"></div>
    <div class="table-wrapper">
      <BaseTable
        :columns="columns"
        :showSort="true"
        :tableData="tableData"
        :pages="{
          show: true,
          count: count,
        }"
        :operate="{
          show: true,
          width: 150,
        }"
        @pagination="pageChange"
      >
        <template #operate="{ current }">
          <el-button
            type="primary"
            size="mini"
            @click="linkTo(`projectQuestionDetails/${current.row.id}`)"
            >详情
          </el-button>
        </template>
      </BaseTable>
    </div>
  </div>
</template>

<script>
import BaseTable from "@/components/Common/BaseTable.vue";
import { getQuestionList } from "@/api/MajorProjectPromotion/Index";
import LinkTo from "@/mixins/LinkTo";
import commonList from "@/mixins/commonList";
export default {
  mixins: [LinkTo, commonList],
  components: { BaseTable },
  data() {
    return {
      columns: columns,
      tableData: [],
      count: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        status: "100",
      },
    };
  },
  methods: {
    initData() {
      getQuestionList(this.queryParams).then((res) => {
        if (res.code == 0) {
          this.tableData = res.data;
          this.count = res.num;
        }
      });
    },
    pageChange(val) {
      this.queryParams.pageNum = val.pageNum;
      this.queryParams.pageSize = val.pageSize;
      this.initData();
    },
  },
  created() {
    this.initData();
  },
};

const columns = [
  {
    prop: "project_name",
    label: "项目名称",
    width: "",
    minWidth: "200",
    align: "",
  },
  {
    prop: "problem_desc",
    label: "问题描述",
    width: "",
    minWidth: "300",
    align: "",
  },
  {
    prop: "",
    label: "承办单位",
    width: "",
    minWidth: "100",
    align: "",
  },
  {
    prop: "",
    label: "交办日期",
    width: "",
    minWidth: "100",
    align: "",
  },
  {
    prop: "",
    label: "反馈状态",
    width: "",
    minWidth: "100",
    align: "",
  },
  {
    prop: "",
    label: "操作",
    width: "",
    minWidth: "80",
    align: "",
  },
];
</script>

<style lang="scss" scoped="">
</style>